var ECharts;
$(document).ready(function () {

    require.config({
        baseUrl: ctx + '/resource/plugins/echarts4',
        paths: {
            echarts: 'echarts',
            roma: 'theme/roma',
        }
    });
    require(
        [
            'echarts',
            'roma'
        ],
        function (ec) {
            ECharts = ec;
            qq = ECharts.init(document.getElementById('qq'), 'roma');//cup仪表盘
            a();
        }
    );
});

var weatherIcons = {
    'Sunny': './data/asset/img/weather/sunny_128.png',
    'Cloudy': './data/asset/img/weather/cloudy_128.png',
    'Showers': './data/asset/img/weather/showers_128.png'
};

var seriesLabel = {
    normal: {
        show: true,
        textBorderColor: '#333',
        textBorderWidth: 2
    }
}

function a() {

    option = {
        tooltip : {
            trigger: 'axis',
            axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        legend: {
            data:['cpu','文件系统','内存']
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis : [
            {
                type : 'category',
                data : ['电能质量在线监测03号应用服务器','JIBEI-CSK2机房G10机柜29U服务器','JIBEI-ZLJ3机房CA09机柜29-30U服务器','应急指挥二期应用服务器']
            }
        ],
        yAxis : [
            {
                type : 'value'
            }
        ],
        series : [
            {
                name:'cpu',
                type:'bar',
                data:[320, 332, 301, 334]
            },
            {
                name:'文件系统',
                type:'bar',
                data:[120, 132, 101, 134]
            },
            {
                name:'内存',
                type:'bar',
                data:[220, 182, 191, 234]
            }
        ]
    };


    qq.setOption(option);
}
